<?php
namespace app\common\validate;

use think\Validate;

class Article extends Validate
{
    protected $rule = [
        'title'         =>  'require',
        'author'        =>  'require',
        'cid'           =>  'require|number',
        'tid'           =>  'require',
        'content'       =>  'require',
        'is_top'        =>  'require|in:0,1',
        'is_original'   =>  'require|in:0,1',
        'status'        =>  'require|in:0,1',

    ];
    protected $message = [
        'title.require'         =>  '标题必填',
        'author.require'        =>  '作者必填',
        'cid.require'           =>  '栏目必选',
        'tid.require'           =>  '标签至少选择一个',
        'content.require'       =>  '内容必填',
        'is_top.require'        =>  '是否置顶必选',
        'is_original.require'   =>  '是否原创必选',
        'status.require'        =>  '是否发布必选',
    ];
}
